import java.util.ArrayList;
import java.util.Iterator;

public class List {
    public static void main(String[] args) {
        Person p1 = new Person("谭子扬",20);
        Person p2 = new Person("张三",22);
        Person p3 = new Person("李四",19);

        ArrayList<Person> list = new ArrayList<Person>();
        list.add(p1);
        list.add(p2);
        list.add(p3);

        Iterator<Person> it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }



}
